<script type="text/javascript">
var process_request = "<?php echo $this->_var['lang']['process_request']; ?>";
</script>

<!--[if IE 6]>
<?php echo $this->smarty_insert_scripts(array('files'=>'DD_belatedPNG_0.0.8a-min.js')); ?>
<script type="text/javascript">
window.attachEvent("onload", function(){
   DD_belatedPNG.fix(".sub_nav,.list-bottom");
});
</script>
<![endif]-->
<div class="block clearfix">
	<div class="welcome">欢迎光临本店</div>
    <ul class="topNav">
    	<?php 
$k = array (
  'name' => 'member_info',
);
echo $this->_echash . $k['name'] . '|' . serialize($k) . $this->_echash;
?>|
    	<?php $_from = $this->_var['navigator_list']['top']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'nav');$this->_foreach['nav_top_list'] = array('total' => count($_from), 'iteration' => 0);
if ($this->_foreach['nav_top_list']['total'] > 0):
    foreach ($_from AS $this->_var['nav']):
        $this->_foreach['nav_top_list']['iteration']++;
?>
           <li> <a href="<?php echo $this->_var['nav']['url']; ?>" <?php if ($this->_var['nav']['opennew'] == 1): ?> target="_blank" <?php endif; ?>><?php echo $this->_var['nav']['name']; ?></a></li>
            <?php if (! ($this->_foreach['nav_top_list']['iteration'] == $this->_foreach['nav_top_list']['total'])): ?> |
            <?php endif; ?>
    <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
    </ul>
</div>

<div  class="blank"></div>
<div  class="maxMainNav block clearfix">
	<div id="logo" class="f_l">
    	<a><img src="themes/max/images/logo.gif"></a>
    </div>
    
<div id="search" class="f_r">
  <div class="keys f_l">
   <script type="text/javascript">
    
    <!--
    function checkSearchForm()
    {
        if(document.getElementById('keyword').value)
        {
            return true;
        }
        else
        {
            alert("<?php echo $this->_var['lang']['no_keywords']; ?>");
            return false;
        }
    }
    -->
    
    </script>
    <?php if ($this->_var['searchkeywords']): ?>
   <?php echo $this->_var['lang']['hot_search']; ?> ：
   <?php $_from = $this->_var['searchkeywords']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'val');if (count($_from)):
    foreach ($_from AS $this->_var['val']):
?>
   <a href="search.php?keywords=<?php echo urlencode($this->_var['val']); ?>"><?php echo $this->_var['val']; ?></a>
   <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
   <?php endif; ?>
  </div>
  <form id="searchForm" name="searchForm" method="get" action="search.php" onSubmit="return checkSearchForm()" >
   <input name="keywords" type="text" id="keyword" value="<?php echo htmlspecialchars($this->_var['search_keywords']); ?>" class="B_input" style="width:110px;"/>
   <input name="imageField" type="submit" value="" class="go" style="cursor:pointer;" />
   </form>
</div>

</div>

<div  class="header-menu clearfix">
	<p><a href="index.php"<?php if ($this->_var['navigator_list']['config']['index'] == 1): ?> class="cur"<?php endif; ?>><?php echo $this->_var['lang']['home']; ?></a></p>
	<ul>

  <?php $_from = $this->_var['navigator_list']['middle']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'nav');$this->_foreach['nav_middle_list'] = array('total' => count($_from), 'iteration' => 0);
if ($this->_foreach['nav_middle_list']['total'] > 0):
    foreach ($_from AS $this->_var['nav']):
        $this->_foreach['nav_middle_list']['iteration']++;
?>

  <li  onMouseOver="sw_nav(this,1);" onMouseOut="sw_nav(this,0);"><a href="<?php echo $this->_var['nav']['url']; ?>" <?php if ($this->_var['nav']['opennew'] == 1): ?>target="_blank" <?php endif; ?> <?php if ($this->_var['nav']['active'] == 1): ?>  class="cur"<?php endif; ?>><?php echo $this->_var['nav']['name']; ?></a>
  <?php
                  $subcates = get_subcate_byurl($GLOBALS['smarty']->_var['nav']['url']);
                    if($subcates!=false)
                        {
                            if(count($subcates)>0)
                            {
                                echo "<div class='sub_nav_container'><ul class='sub_nav'>";
                                if($subcates)
                                {
                                    foreach($subcates as $cate)
                                    {
                                            echo "<li class='sub'><a href='".$cate['url']."' class='level_1' >".$cate['name']."</a></li>";
                                    } 
                                }
                                echo "</ul><div class='list-bottom'></div><iframe frameborder='0' scrolling='no' class='nomask'></iframe></div>";
                            }
                        }
                        
   ?>
 <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
 
</li>
</div>
<script type="text/javascript">
      //初始化主菜单
                function sw_nav(obj,tag)
                {

                        var subdivs = obj.getElementsByTagName("DIV");
                        var ifs = obj.getElementsByTagName("IFRAME");
						var a = obj.getElementsByTagName("a");
					
                        if(subdivs.length>0)
                        {
                                if(tag==1)
                                {
                                        subdivs[0].style.display = "block";
										subdivs[1].style.top = obj.getElementsByTagName("UL")[0].offsetHeight+"px";
                                        ifs[0].style.display = "block";
                                        a[0].className="curx";
                                }
                                else
                                {
                                        subdivs[0].style.display = "none";								
                                        ifs[0].style.display = "none";
                                        a[0].className="cur";
                                }

                        }
                }

      </script>
